package com.bingxue.edu.parent.controller;

import com.bingxue.edu.framework.common.model.Response;
import com.bingxue.edu.management.education.model.entity.exam.Exam;
import com.bingxue.edu.parent.model.query.ExamReportQuery;
import com.bingxue.edu.parent.model.resp.ParentMyScoreDetailResp;
import com.bingxue.edu.parent.model.resp.ParentMyScoreResp;
import com.bingxue.edu.parent.model.resp.StudentExamRecordReportResp;
import com.bingxue.edu.parent.service.StudentExamService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@Tag(name = "家长端小程序-分数模块")
@RequestMapping("/p/my-score")
@RequiredArgsConstructor
public class StudentExamController {

    private final StudentExamService studentExamService;

    @Operation(summary = "获取我的分数")
    @GetMapping("/{studentId}")
    public Response<List<ParentMyScoreResp>> myScore(@PathVariable String studentId) {

        return Response.success(studentExamService.getMyScore(studentId));
    }

    @Operation(summary = "获取我的分数详情")
    @GetMapping("/detail/{examRecordId}")
    public Response<ParentMyScoreDetailResp> myScoreDetail(@PathVariable String examRecordId) {
        return Response.success(studentExamService.getMyScoreDetail(examRecordId));
    }

//    @Operation(summary = "获取考试成绩分布")
//    @GetMapping("/report")
//    public Response<StudentExamRecordReportResp> getRecordReport(ExamReportQuery query) {
//        //Todo::
//        return Response.success(studentExamService.getRecordReport(query.getExamId(),query.getExamRecordId()));
//    }
}
